﻿
function pageLoad(sender, args)
{
    if(IsFriend==1)
    {
        $get("Panel2").style.display="";
    }
    else if(IsLink==1)
    {
        $get("Panel3").style.display="";
    }
    else if(IsAgreeFriend==0)
    {
        $get("Panel4").style.display="";
    }
    else
    {
        if((1 & EmailOption) == 1)
        {
            $get("Panel1").style.display="";
        }
        else{
            $get("AddPanel").style.display="";
        }
    }
    CreateValid();
}
function AddFSendM()
{    
    if(!validationForm(new validationOptions('Send', '', true, ''))) return;    
    AddNewFriend(1);
}
//添加朋友(1发送邮件,0不发送)
function AddNewFriend(sendType)
{    
    WebServices.User.Contacts.AddNewFriend(MyMemberno,FMemberno,onsuccOP,null,sendType);    
}
function onsuccOP(result,sendType)
{
    if(result.State) 
    {
        if(sendType==0)
        {
            $get("AddPanel").style.display="none";
        }
        else if(sendType==1)
        {
            WebServices.User.Contacts.SendMail1(FMemberno,FNickName,MyNickName,FEmail,$get("txtContent").value);
            $get("Panel1").style.display="none";            
        }
        $get("Succeed").style.display="";
    }
    else
    {
        $get("AddPanel").style.display="none";
        $get("Panel1").style.display="none";
        $get("failure").style.display="";
    }
}
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
